package com.qf.flash.ui.business.adapter;

import android.widget.ImageView;

import com.qf.flash.R;
import com.qf.flash.model.GameGroupBean;
import com.qf.flash.utils.ImageLoader;
import com.qf.flashlib.adapter.BaseRViewItem;
import com.qf.flashlib.adapter.RViewHolder;

/**
 * 创建日期：2020/3/14 on 11:59
 * 描述: 订单大厅
 * 作者:戴旭东
 */
public class OrderHallItem extends BaseRViewItem<GameGroupBean> {

    @Override
    public int getItemLayout() {
        return R.layout.item_order_hall;
    }

    @Override
    public void convert(RViewHolder holder, GameGroupBean bean, int position, int itemSize) {

        holder.setOnClickListener(R.id.cv_group)
                .setOnClickListener(R.id.tv_jiedan);
        holder.setText(R.id.tv_count, bean.getPayedNum()+" / " +bean.getNeedNum())
                .setText(R.id.tv_name,bean.getTeamName())
                .setText(R.id.tv_group_no, bean.getOrderNumber())
                .setText(R.id.tv_nick_name, bean.getCaptainName())
                .setText(R.id.tv_time, bean.getGameTime())
                .setText(R.id.tv_type, bean.getTypeName())
                .setText(R.id.tv_bus_name,bean.getShop().getName())
                .setText(R.id.tv_address, bean.getShop().getLocation());
        ImageView ivImg = holder.getView(R.id.iv_img);
        ImageLoader.loadRoundCorners(ivImg.getContext(), bean.getPlayImage(), ivImg, 5);
    }
}
